import Taro from '@tarojs/taro'

function get(url) {
    return Taro.request({
        url: url,
        header: {
            'content-type': 'application/json'
        }
    });
}

function post(url,data) {
    return Taro.request({
        url: url,
        method: 'POST',
        header: {
            'content-type': 'application/json'
        },
        data: data
    })
}

const HOST = 'https://eric.vipdesk.cn/api';

const url = {
    getEvents:  `${HOST}/events.json`,
    createEvent:  `${HOST}/events.json`,
    uploadBannerImg: `${HOST}/events/upload_banner_img`
}

export {get, post,url}
